package ch.zbw.timeline.service;

import java.util.List;

import ch.zbw.timeline.domain.Allocation;
import ch.zbw.timeline.domain.Employee;
import ch.zbw.timeline.domain.OverTimePool;

/**
 * Interface that handles the overTimePools OverTimePools can be generated and
 * saved to the database The OverTimePools can be read from the database
 * 
 * @author Marco Ramseyer
 * 
 */
public interface OverTimePoolService {

	/**
	 * Method to create a new overTimePool A new overTimePool is created with
	 * the given parameters and is saved to the database
	 * 
	 * @param employee
	 *            the employee that is allocated
	 * @param hours
	 *            the number of hours that are available
	 * @param description
	 *            the description that describes the overTimePool
	 * @return returns a instance of the created overTimePool
	 */
	public OverTimePool createOverTimePool(Employee employee, double hours, String description);

	/**
	 * Method to save and update a overTimePool to the database The given
	 * overTimePool is saved to the database
	 * 
	 * @param overTimePool
	 *            the given overTimePool that should be updated or saved to the
	 *            database
	 * @return returns the updated overTimePool
	 */
	public OverTimePool saveOverTimePool(OverTimePool overTimePool);

	/**
	 * Method to get all overTimePools that have been saved so far
	 * 
	 * @return returns a list of overTimePool
	 */
	public List<OverTimePool> getAllOverTimePools();

	/**
	 * Method to get a specified overTimePool that is allocated to a employee
	 * With the employee that is given as a parameter, the overTimePool is
	 * searched
	 * 
	 * @param employee
	 *            the employee thats overTimePool is expected
	 * @return returns the overTimePool from the employee
	 */
	public OverTimePool getOverTimePool(Employee employee);

	/**
	 * Method to get all allocations from a overTimePool that is allocated to a
	 * employee With the employee that is given as a parameter, the overTimePool
	 * is searched and the allocations are selected
	 * 
	 * @param employee
	 *            the employee thats overTimePool's allocations are expected
	 * @return returns a list of allocations
	 */
	public List<Allocation> getOverTimePoolAllocations(Employee employee);

	/**
	 * Method to get the hours that are already used in the overTimePool from a
	 * specified employee
	 * 
	 * @param employee
	 *            employee the employee thats used hours of a overTimePool are
	 *            expected
	 * @return returns a value of the used hours
	 */
	public double getOverTimePoolHoursUsed(Employee employee);
}
